package com.hailong.hadoop.rpc.protobuf;

import com.google.protobuf.RpcController;
import com.google.protobuf.ServiceException;
import com.hailong.hadoop.rpc.protobuf.proto.MyResourceTrackerMessage;


/**
 * Created by 31464 on 2022/1/11.
 */
public class MyResourceTrackerServerSidePB implements MyResourceTrackerPB {

    final MyResourceTracker server;

    public MyResourceTrackerServerSidePB(MyResourceTracker server){
        this.server=server;
    }

    @Override
    public MyResourceTrackerMessage.MyRegisterNodeManagerResponseProto registerNodeManager(RpcController controller, MyResourceTrackerMessage.MyRegisterNodeManagerRequestProto request) throws ServiceException {
        try {
            return this.server.registerNodeManager(request);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
